export const rowSelection = {
	data() {
		return {
			selectedRowKeys: []
		}
	},
	computed: {

	},
	created() {

	},
	methods: {
		/* 选中checkbox */
		onSelectChange(selectedRowKeys) {
			this.selectedRowKeys = selectedRowKeys;
			const selectedRowChange = this.$listeners['selectedRowChange'];
			if (selectedRowChange && typeof selectedRowChange === 'function') {
				selectedRowChange(selectedRowKeys);
			}
		}
	}
};
export const tableResize = {
	data() {
		return {
			scrolly: 500,
			viewlistTop: 0
		}
	},
	methods: {
		onResize(resize) {
			let marginTop = 10;
			let tableHeader = 44;
			let tableFooter = 60;
			this.scrolly = resize.height - tableHeader - tableFooter;
		}
	}
};
/* 弹出框的公共设置 */
export const ModalMixins = {
	data() {
		return {
			modalWidth: 800,
			bodyStyle: {
				maxHeight: '450px',
				overflow: 'auto'
			},
			labelCol: {
				xs: {
					span: 24
				},
				sm: {
					span: 5
				}
			},
			wrapperCol: {
				xs: {
					span: 24
				},
				sm: {
					span: 16
				}
			},
			visible: false,
			confirmLoading: false,
			mdl: {},
			form: this.$form.createForm(this),
			title: '新增',
			isAdd: true
		}
	},
	methods: {
		/**
		 * @description  清除输入框中的空格
		 * @param {Object} e change事件的参数
		 */
		removeSpaces(e) {
			return e.target.value.trim();
			// return e.target.value.replace("\\u200B","")
		}
	}
};
